package com.fms.gui.existingSheets;

import java.awt.Color;

import javax.swing.JTable;

import com.fms.gui.existingSheets.buttons.IButtonBuilder;
import com.fms.model.domain.IExistingFlowSheets;

public class ExistingSheetTable extends JTable
{
	/**
	 * 
	 */
	private static final long	serialVersionUID	= -4567086244245616259L;

	public ExistingSheetTable(IExistingFlowSheets _sheets, IButtonBuilder editButton, IButtonBuilder sendButton)
	{
		super(new ExistingSheetModel(_sheets));
		this.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		
		
		
		this.setRowHeight(20);
		this.getColumnModel().getColumn(0).setCellRenderer(new CenteredTextRenderer());
		this.getColumnModel().getColumn(0).setWidth(100);
		this.getColumnModel().getColumn(0).setMinWidth(100);
		this.getColumnModel().getColumn(0).setMaxWidth(100);
		this.getColumnModel().getColumn(0).setHeaderValue("Flow Sheet");		
		this.getColumnModel().getColumn(0).setResizable(false);
		this.getColumnModel().getColumn(1).setCellRenderer(new CenteredTextRenderer());
		this.getColumnModel().getColumn(2).setCellRenderer(new GreenRedHighlighter("Emailed"));
		
		ButtonRenderer r = new ButtonRenderer(editButton);
		this.getColumnModel().getColumn(3).setCellRenderer(r);
		this.getColumnModel().getColumn(3).setCellEditor(r);
		this.getColumnModel().getColumn(3).setWidth(80);
		this.getColumnModel().getColumn(3).setMinWidth(80);
		this.getColumnModel().getColumn(3).setMaxWidth(80);
		
		
		this.setGridColor(Color.white);
		
	}



}
